﻿using System.Configuration;

namespace Dqaqs.Data
{
	public static class DataConatiner
	{
		public static readonly string ConnectionString = ConfigurationManager.ConnectionStrings["DqaqsContainer"].ConnectionString;
		private static readonly string EfConnectionString = ConfigurationManager.ConnectionStrings["efConnectionString"].ConnectionString
			.Replace("{0}", ConfigurationManager.ConnectionStrings["DqaqsContainer"].ConnectionString);

		public static DqaqsContainer New()
		{
			var rv = new DqaqsContainer( EfConnectionString );
			rv.ContextOptions.LazyLoadingEnabled = false;
			rv.ContextOptions.ProxyCreationEnabled = false;
			return rv;
		}
	}
}
